# Contributor: Johannes Matheis <jomat+alpinebuild@jmt.gr>
# Maintainer: Johannes Matheis <jomat+alpinebuild@jmt.gr>
pkgname=i3lock
pkgver=2.12
pkgrel=0
pkgdesc="An improved screenlocker based upon XCB and PAM"
url="https://i3wm.org/i3lock/"
arch="all"
license="MIT"
depends="xkeyboard-config"
makedepends="libev-dev cairo-dev linux-pam-dev libxkbcommon-dev
	xcb-util-image-dev xcb-util-xrm-dev"
subpackages="$pkgname-doc"
source="https://i3wm.org/i3lock/i3lock-$pkgver.tar.bz2"

prepare() {
	default_prepare

	# Fix ticket FS#31544, sed line taken from gentoo
	sed -i -e 's:login:base-auth:g' pam/i3lock
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-builddir
	make
}

check() {
	./i3lock -v
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="84f1558368381bcad9a64f41ab6134a6614dea453d1ee5ecfe886185b9e1baebeeca446c4635158deb8dae5b25c09d47d3990239d76c44e5325ca5bfaad9b2ad  i3lock-2.12.tar.bz2"
